//
//  TenderAPI.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2024/10/15.
//  Copyright © 2024 zwb. All rights reserved.
//
 
import UIKit
import Moya
import Photos
enum TenderAPI {
    case login(username: String, password: String,identity_type:String) // 登录
    case getBrand // 饲料价格方案
    case saveOrders(goods: String, thrj: String, memo: String,advance_bs:String)  // 保存饲料订单
    case getOrders(page: Int) // 采购查询 获得订单主表
    case getOrdersDetail(idkey: String) // 获得订单的细表
    case deleteOrder(idkey: String) // 删除订单
    case getOrdersById(idkey: String) // 根据订单ID查询订单主表
    case modifypwd(oldpwd: String, newpwd: String) // 修改密码
    case queryClientAddress(k_addr_type:String)
    case addClientAddress(data: String, idKey: String)
    case deleteClientAddress(idkey: String)
    case updateOrders(main: String, detail: String)
    
    case addr(_ api:AddressAPI)

    // 对账单列表
    case getCheckingBill(userId: String, time: String)
    
    //  实名认证 ----------------------------------------------
    // 获取令牌
    case authcsrf
    // 登录
    case authLogin
    
    // 验证 手机
    case thirdPart2submit_mobile
    // 验证 银行卡
    case thirdPart2submit_bankcard
    
    // 新的 上传验证后的 个人信息
    case addAuthentication(name:String,idNo:String,id:String,phone:String,vouPhone:String,bankCard:String)
    
    // 是否认证
    case ifFaceRecognition(id:String,clientId:String)
    
    // 签章
    case signature(userId:String,time:String,code:String,clientId:String,idNo:String)
    
    // 签章查询
    case getCheckingBillList(userId: String)
    // 进销存查询
    case getStockMonth(begin_dt:String,end_dt:String,kf_id:String,s_goods_code:String,curr_page:String,pageLength:String)
    
    
    // 看合同
    case viewContract(fileNo:String)
    
    // 新人脸获取  token
    case accessToken_new(userId:String)
    
    /// 获取faceid
    case getfaceid(webankAppId:String,orderNo:String,userId:String,nonce:String,version:String,sign:String,name:String,idNo:String)
    
    // 采购报价
    case queryMytenderZbList(z_begin_dt:String,z_end_dt:String,z_province:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String,category:String,z_status:String)
    case queryBidRecordList(z_zb_id:String,z_bid_id:String,z_staff_id:String)
    case queryTbRecordList(z_zb_id:String,z_bid_id:String,z_staff_id:String)
    case queryMytenderJpList(z_begin_dt:String,z_end_dt:String,z_province:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String,z_out_dt:String,z_status:String)
    // 采购详情
    case queryMytenderZbInfo(id_key:String)
    case queryMytenderJpInfo(id_key:String)
    
    // 中标列表
    case ztbQueryMytenderWinList(z_city:String,page:String,size:String,z_title:String)
    case queryAuctionList(z_city:String,page:String,size:String,z_title:String)
    
    // 我的出价
    case queryMytenderZbBidList(z_begin_dt:String,z_end_dt:String,z_province:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String,category:String)
    // 我发布的
    case queryMyPublishZbList(z_begin_dt:String,z_end_dt:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String)
    // 我的销售出价
    case queryMyPublishJpList(z_begin_dt:String,z_end_dt:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String)
    case queryMytenderJpJoinList(z_begin_dt:String,z_end_dt:String,z_city:String,z_price_min:String,z_price_max:String,page:String,size:String,z_title:String,z_status:String)
    // 反提交采购
    case referMytenderZbInfo(id_key:String,z_tag:String)
    // 新增修改采购
    case saveMytenderZbInfo(data:String,file:Data?)
    case updateMytenderZbInfo(data:String,file:Data?)
    // 收藏功能
    case setRecordMark(z_record_id:String,z_mark:String,z_type:String)
    // 删除出价
    case deleteMytenderZb(id_key:String)
    // 查看我的出价
    case queryMytenderTbInfo(z_tb_id:String)
    case queryBidInfo(z_bid_id:String)
    // 中标详情
    case queryMytenderWinInfo(id_key:String)
    case queryAuctionInfo(id_key:String)
    // 出价记录
    case queryMytenderTbList(page:String,size:String,z_zb_id:String,z_title:String)
    // 放弃
    case deleteMytenderTbInfo(id_key:String)
    // 确认协议时保存h用户信息
    case saveOptInfo(data:String)
    // 保存我的出价
    case saveMytenderTbInfo(data:String)
    // 保存我的销售出价
    case saveMytenderBidInfo(data:String)
    // 修改出价记录
    case updateMytenderTbInfo(data:String)
    // 修改销售出价记录
    case updateMytenderBidInfo(data:String)
    // 查看出价的保证金信息
    
    case queryTbDepositPaymentInfo(id_key:String)
    
    case abandonAuction(id_key:String)
    // 保存出价保证金
    
    case saveDepositPaymentInfo
    //  获取计量单位
    case getUnitDic
 
    // 获取账户类型和行业类型
    case getUserType
    // 发送验证码
    case sendSMSForReg(provider_tel:String,ip:String,picVerifyCode:String)
    // 注册接口
    case RegUser(verificationCode:String,master:String)
    // 获取个人信息
    case getUserInfoForUpdate(idkey:String)
    // 修改个人信息
    case submitUserInfoForUpdate(master:String)
    
    
    //  为了公用而配置，只有在oa中有用
    // 再审的    流程id获取审核信息
    case getAuditInfoByProcess(process:String)
    // 审核完的     获取 审核信息
    case updateSubmitWaitInfoNew(process:String)
    //  用id 获取审核信息
    case getSubmitWaitInfoByVouidVoc(vou_id:String,voc_cd:String)
    //  审批前获取审批需要的乱七八糟的数据
    case getVouShowInfoNew(proc_inst_id:String)
    
    // 获取转办人
    case getSendWorkAccStaff
    // 审批
    case eventAudit(vou_no:String,voc_cd:String,process:String,memo:String,vou_id:String,staff_nm:String,post_nm:String,post_id:String,staff_id:String,verify_mark:String,audit_id:String,audit_dt:String,task_id:String,flow_var:String,dept_id:String,unit_id:String)
    // 转办
    
    case eventSendWork(vou_no:String,voc_cd:String,process:String,vou_id:String,acc_staff_id:String,send_dt:String,send_post_id:String,audit_id:String,task_id:String)
    // 校验手机号和税号
    
    case regCheckInfo(provider_tel:String,tax_no:String)
    // 我的收藏
    case myFavoriteList(z_staff_id:String,page:String,size:String,z_type:String,category:String)
    // 我的保证金余额
    case getMyDepositBalance(z_staff_id:String)
    // 我的保证金列表
    case queryMyDepositList(z_staff_id:String,audit_mark:String,search_info:String,page:String,size:String)
    // 保证金退款，取消退款
    case refundMyDepositInfo(id_key:String,opt_type:String)    //0:取消退款;1:退款
    
    case setDefaultGroup(s_group_id:String,s_vou_id:String)
    // 检查更新
    case getUpdateInfo
    // 资金流水
    case queryCashFlowList(page:String,size:String)
    
    case abandonBidInfo(id_key:String)
    
    
    case queryUserUnreadMessagesCount
    case queryMessagesList(page:String,size:String)
    case setMessagesRead(messageIdList:String)
    
    case giveUpToUpdate(client_id:String)
    
    case getAccountInfo
    
    case queryNoticeInfo(page:String,size:String)
    case queryNoticeInfoNotRead
    case saveNoticeRead(id_key:String)
    case countNoticeInfoNotRead
    
    case getOrdersAudit(page:String,size:String,s_orderform_no:String)
    case payApplyQuery(page:String,size:String,s_orderform_no:String)
    case payApplySave(date:String,payMoney:String)
    case payApplyDelete(id_key:String)
    case queryCollectionAccount(id_key:String)
    case syncBankRecord(id_key:String)
    case getDormAndVedioInfoByAccount(client_id:String)
    
    case queryLogistics(page:String,size:String,z_title:String,z_city:String,z_begin_dt:String,z_end_dt:String,z_type:String,z_status:String)
    case getLogistics(id_key:String)
    case saveLogistics(data:String,detail:String)
    case updateLogistics(data:String,detail:String)
    
    case deleteLogistics(id_key:String)
    case queryContract(page:String,size:String,z_title:String)
    case queryContractGoodsNew(z_contract_id:String)
    case queryLogisticsCompany
    case queryLogisticsDetail(z_logistics_no:String,z_logistics_nm:String,z_consigner_tel:String)
    
    
    case getReportInfo(big_menu_id:String)
    
    case uploadPic(pictures:[UIImage])
    
    
    // ----\(memStr.unicode2Str())体系
    case queryEquity(member_type:String)
    case queryPackage
    case  memberSave(due_date:String,member_type:String,package_type:String,client_id:String)
    case  memberUpdate(due_date:String,member_type:String,package_type:String,client_id:String)
    case queryMemberInfo(client_id:String)
    case refillDownOrder(data:String)
    case getPic(id_key:String)
    case headUploadPic(id_key:String,img:UIImage)
    case getViewpager
    case eSignControllerQuery(page:String,size:String,startDate:String,endDate:String,keyWord:String)
    case eSignQueryScale(z_ht_no:String)
    case eSignQueryLibrary(z_ht_no:String)
    case eSignQueryPay(z_ht_no:String)
    case eSignGetFileList(s_type:String,z_ht_no:String)
    case eSignDeleteFile(id:String)

    case eSignUploadFiles(s_type:String,z_ht_no:String,files:[VideoImg])

    
  
    
    
    case viewFile(flow_id:String,org_code:String)
    
    
    case getPicVerifyCode(phone:String,ip:String)
    case queryAddress(page:String,size:String,z_title:String,z_contract_id:String)
    
    case pFoodQueryOrder(page:String,size:String,s_begin_dt:String,s_end_dt:String,s_money_min:String,s_money_max:String,s_title:String,s_city:String,s_status:String)
    
    case pFoodGetForm(id_key:String)
    case pFoodSave(data:String)
    case pFoodUpdate(data:String)
    case pFoodDelete(id_key:String)
    case pFoodRefer(id_key:String)
    case pFoodUnRefer(id_key:String)
    case pFoodQueryOrg(s_title:String,s_client_id:String)
    case pFoodQueryOrgByStaff(s_title:String,s_staff_id:String)
    case pFoodQueryClient(page:String,size:String,s_title:String,s_staff_id:String,s_org_id:String)
    case pFoodQueryTypeAndSecType(s_org_id:String)
    case pFoodQueryGoodsByType(s_org_id:String,s_client_id:String,s_customer_branch_id:String,s_date:String)
    case pFoodQueryGoodsBySearch(page:String,size:String,s_title:String,s_org_id:String,s_client_id:String)
    case pFoodQueryGoodsByMark(page:String,size:String,s_title:String,s_org_id:String,s_client_id:String)
    case pFoodSetRecordMark(s_type:String,s_record_id:String,s_mark:String)
    case pFoodQueryBalance(s_org_id:String,s_client_id:String)
    case pFoodQueryGoodsPrice(s_org_id:String,s_client_id:String,s_goods_id:String,s_date:String,s_customer_branch_id:String)
    
    case queryBranchClient(s_title:String,s_client_id:String)
    
    case  supplierCheckBillHome(p_supplier_id:String,p_month:String)
    case supplierTableQuery(type:String,id_key:String)
    
    
    case queryInvoicLookUp(data:String)
    case insertOrUpdateInvoicLookUp(data:String)
    case queryInvoice(data:String)
    case openInvoice(data:String)
    case queryOrderList(data:String)
    case deleteInvoicLookUp(id_key:String)
    case getInvoiceDetail(id_key:String)
    case dieTypeLov
    case dieCauseLov
    case modeTypeLov
    case YhDeadUpdate(master:String,details:String)
    case YhDeadSave(master:String,details:String)
    case YhDeadRefer(id_key:String,audit_mark:String)
    case YhDeadUnrefer(id_key:String,audit_mark:String)
    case YhDeaddelete(id_key:String)
    
    
    
    case dieDormLov
    
    case queryPictureList(id_key:String)
    case YhDeadqueryList(startDate:String,endDate:String,keyWord:String)
    //    // 加图片  养户
    case uploadPicture_f(pic_data:String,images:[UIImage])
    // 删图片  养户
    case deletePicture_f(id_key:String)
    
    case carloglist(page:String,size:String,keyword:String)
    case getGoodsType
    case  carlogid(id:String)
     case getTripLog(id:String,type:String)

   case saveTriplog(data:[String:Any])
    case carlogsave(data:[String:Any])
    case carlogupdate(data:[String:Any])
    case carlogdelete(id:String)
    case carfilelist(vou_id:String)
    case carfileDelete(id:String,path:String)
    
    case carlocationlist(vou_id:String)
    case carlocationupload(vou_id:String,longitude:String,latitude:String,address:String)
    
    case carfeelist(page:String,size:String,vou_id:String)
    case carfee(id:String)
    case carfeesave(data:[String:Any])
    case carfeeupdate(data:[String:Any])
    case saveFeedbackInfo(data:String,files:[VideoImg])
    
    case queryFeedbackInfo(page:String,size:String)
    case getFeedbackInfo(id_key:String)
    case delFeedbackInfo(id_key:String)
    case queryZbCarInfo(id_key:String)
    case updateZbCarInfo(data:String)
    case delZbCarInfo(id_key:String)
    
    case queryProtocol
    case saveProtocolSure(data:String)
    case getServerTime
    
    
    case queryStock(page: Int, title: String)
    
    case queryMytenderJpListDetailV3(id_key:String)
    case queryMytenderZbListDetail(id_key:String)

    
}

extension TenderAPI: TargetType {
    
    var baseURL: URL {
        
        switch self {
        case .addr(let api):
            return api.baseURL
        case .authcsrf,
                .thirdPart2submit_bankcard,
                .thirdPart2submit_mobile,
                .authLogin:
            return URL(string: AppUrl.verifyURL)!
        case .getfaceid:
            return URL(string: AppUrl.TXgetFaceidURL)!
       
        default:
            return URL(string: HTTPStr)!
        }
        
    }
    
    var path: String {
        switch self {
      
        case .addr(let api):
            return api.path
        case .login:
            return "login"
        case .getBrand:
            return "getBrand"
        case .saveOrders:
            return "saveOrders"
        case .getOrders:
            return "getOrders"
        case .getOrdersDetail:
            return "getOrdersDt"
        case .deleteOrder:
            return "deleteOrders"
        case .getOrdersById:
            return "getOrdersById"
        case .modifypwd:
            return "modifypwd"
        case .queryClientAddress:
            return "queryClientAddress"
        case .addClientAddress:
            return "AddClientAddress"
        case .deleteClientAddress:
            return "deleteClientAddress"
        case .updateOrders:
            return "updateOrders"
        case .getCheckingBill:
            return "checkingBill/getCheckingBill"
        case .authcsrf:
            return "auth/csrf"
        case .authLogin:
            return "auth/ajaxLogin"
        case   .thirdPart2submit_bankcard,
                .thirdPart2submit_mobile:
            return "thirdPart2/submit"
        case .addAuthentication:
            return "face/addAuthentication"
        case .ifFaceRecognition:
            return "face/ifFaceRecognition"
        case .signature:
            return "checkingBill/signature"
            
        case .getCheckingBillList:
            return "checkingBill/getCheckingBillList"
        case .getStockMonth:
            return "wapQuery/getStockMonth"
        case .viewContract:
            return "checkingBill/viewContract"
        case .accessToken_new:
            return "face/accessToken"
        case .getfaceid:
            return "api/server/getfaceid"
        case .queryMytenderZbList:
            return "ztb/queryMytenderZbList"
            
        case .queryTbRecordList:
            return "ztb/queryTbRecordList"
        case .queryBidRecordList:
            return "ztb/queryBidRecordList"
        case .queryMytenderJpList:
            return "ztb/queryMytenderJpList"
        case .queryMytenderZbInfo:
            return "ztb/queryMytenderZbInfo"
        case .queryMytenderJpInfo:
            return "ztb/queryMytenderJpInfo"
        case .ztbQueryMytenderWinList:
            return "ztb/queryMytenderWinList"
        case .queryAuctionList:
            return "ztb/queryAuctionList"
        case .queryMytenderZbBidList:
            return "ztb/queryMytenderZbBidList"
        case .queryMyPublishZbList:
            return "ztb/queryMyPublishZbList"
        case .queryMyPublishJpList:
            return "ztb/queryMyPublishJpList"
        case .queryMytenderJpJoinList:
            return "ztb/queryMytenderJpJoinList"
        case .referMytenderZbInfo:
            return "ztb/referMytenderZbInfo"
        case .updateMytenderZbInfo:
            return "ztb/updateMytenderZbInfo"
        case .saveMytenderZbInfo:
            return "ztb/saveMytenderZbInfo"
        case .setRecordMark:
            return "ztb/setRecordMark"
        case .deleteMytenderZb:
            return "ztb/deleteMytenderZb"
        case .queryMytenderTbInfo:
            return "ztb/queryMytenderTbInfo"
        case .queryBidInfo:
            return "ztb/queryBidInfo"
        case .queryMytenderWinInfo:
            return "ztb/queryMytenderWinInfo"
        case .queryAuctionInfo:
            return "ztb/queryAuctionInfo"
        case .queryMytenderTbList:
            return "ztb/queryMytenderTbList"
        case .deleteMytenderTbInfo:
            return "ztb/deleteMytenderTbInfo"
        case .saveOptInfo:
            return "ztb/saveOptInfo"
        case .saveMytenderTbInfo:
            return "ztb/saveMytenderTbInfo"
        case .saveMytenderBidInfo:
            return "ztb/saveMytenderBidInfo"
        case .updateMytenderTbInfo:
            return "ztb/updateMytenderTbInfo"
        case .updateMytenderBidInfo:
            return "ztb/updateMytenderBidInfo"
        case .queryTbDepositPaymentInfo:
            return "ztb/queryTbDepositPaymentInfo"
        case .saveDepositPaymentInfo:
            return "ztb/saveDepositPaymentInfoV2"
        case .getUnitDic:
            return "ztb/getUnitDic"
       
        case .getUserType:
            return "RegController/getUserType"
        case .sendSMSForReg:
            return "RegController/sendSMSForReg"
        case .RegUser:
            return "RegController/RegUser"
        case .getUserInfoForUpdate:
            return "RegController/getUserInfoForUpdate"
        case .submitUserInfoForUpdate:
            return "RegController/submitUserInfoForUpdate"
        case .updateSubmitWaitInfoNew:
            return "/atvwk/event/updateSubmitWaitInfoNew"
        case .getSubmitWaitInfoByVouidVoc:
            return "/atvwk/event/getSubmitWaitInfoByVouidVoc"
        case .getAuditInfoByProcess:
            return "/atvwk/event/getAuditInfoByProcess"
        case .getVouShowInfoNew:
            return "/atvwk/event/getVouShowInfoNew"
        case .getSendWorkAccStaff:
            return "/atvwk/event/getSendWorkAccStaff"
        case .eventAudit(let vou_no, let voc_cd, let process, let memo, let vou_id, let staff_nm, let post_nm, let post_id, let staff_id, let verify_mark, let audit_id, let audit_dt, let task_id, let flow_var, let dept_id, let unit_id):
            return  ""
        case .eventSendWork(let vou_no, let voc_cd, let process, let vou_id, let acc_staff_id, let send_dt, let send_post_id, let audit_id, let task_id):
            return  ""
        case .regCheckInfo:
            return "RegController/regCheckInfo"
        case .myFavoriteList:
            return "ztb/myFavoriteList"
        case .getMyDepositBalance:
            return "ztb/getMyDepositBalance"
        case .queryMyDepositList:
            return "ztb/queryMyDepositListV2"
        case .refundMyDepositInfo:
            return "ztb/refundMyDepositInfo"
            
        case .getUpdateInfo:
            return "getUpdateInfo"
        case .queryCashFlowList:
            return "ztb/queryCashFlowList"
        case .abandonBidInfo:
            return "ztb/abandonBidInfo"
        case .queryUserUnreadMessagesCount:
            return "ztb/queryUserUnreadMessagesCount"
        case .queryMessagesList:
            return "ztb/queryMessagesList"
        case .setMessagesRead:
            return "ztb/setMessagesRead"
        case .giveUpToUpdate:
            return "RegController/giveUpToUpdate"
        case .getAccountInfo:
            return "ztb/getAccountInfo"
        case .queryNoticeInfo:
            return "info/queryNoticeInfo"
        case .queryNoticeInfoNotRead:
            return "info/queryNoticeInfoNotRead"
        case .saveNoticeRead:
            return "info/saveNoticeRead"
        case .countNoticeInfoNotRead:
            return "info/countNoticeInfoNotRead"
        case .getOrdersAudit:
            return "getOrdersAudit"
        case .payApplyQuery:
            return "KfPayApplyController/query"
        case .payApplySave:
            return "KfPayApplyController/save"
        case .payApplyDelete:
            return "KfPayApplyController/delete"
        case .queryCollectionAccount:
            return "KfPayApplyController/queryCollectionAccount"
        case .syncBankRecord:
            return "syncBankRecord"
        case .getDormAndVedioInfoByAccount:
            return "camera/getDormAndVedioInfoByAccount"
        case .queryLogistics:
            return "ztb/queryLogistics"
        case .getLogistics:
            return "ztb/getLogistics"
        case .saveLogistics:
            return "ztb/saveLogisticsNew"
            
        case .updateLogistics:
            return "ztb/updateLogisticsNew"
            
        case .deleteLogistics:
            return "ztb/deleteLogistics"
            
        case .queryContract:
            return "ztb/queryContract"
            
        case .queryContractGoodsNew:
            return "ztb/queryContractGoodsNew"
            
        case .queryLogisticsCompany:
            return "ztb/queryLogisticsCompany"
        case .queryLogisticsDetail:
            return "ztb/queryLogisticsDetailNew"
        case .getReportInfo:
            return "AppBaseController/getReportInfo"
        case .uploadPic:
            return "ztb/uploadPic"
        case .queryEquity:
            return "member/queryEquity"
        case .queryPackage:
            return "member/queryPackage"
        case .memberSave:
            return "member/memberSave"
        case .memberUpdate:
            return "member/memberUpdate"
        case .queryMemberInfo:
            return "member/queryMemberInfo"
        case .refillDownOrder:
            return "member/refillDownOrder"
        case .getPic:
            return "headPic/getPic"
        case .headUploadPic:
            return "headPic/uploadPic"
        case .getViewpager:
            return "headPic/getViewpager"
        case .eSignControllerQuery:
            return "/ESignController/query"
        case .viewFile:
            return "/ESignController/viewFile"
        case .getPicVerifyCode:
            return  "/RegController/getPicVerifyCode"
            
        case .queryAddress:
            return "ztb/queryAddress"
            
        case .pFoodQueryOrder:
            return "/pfoodOrder/queryOrder"
        case .pFoodGetForm:
            return "/pfoodOrder/getForm"
        case .pFoodSave:
            return "/pfoodOrder/save"
        case .pFoodUpdate:
            return "/pfoodOrder/update"
        case .pFoodDelete:
            return "/pfoodOrder/delete"
        case .pFoodRefer:
            return "/pfoodOrder/refer"
        case .pFoodUnRefer:
            return "/pfoodOrder/unRefer"
        case .pFoodQueryOrg:
            return "/pfoodOrder/queryOrg"
        case .pFoodQueryOrgByStaff:
            return "/pfoodOrder/queryOrgByStaff"
        case .pFoodQueryClient:
            return "/pfoodOrder/queryClient"
            
        case .pFoodQueryTypeAndSecType:
            return "/pfoodOrder/queryTypeAndSecType"
            
        case .pFoodQueryGoodsByType:
            return "/pfoodOrder/queryGoodsByTypeSecond"
            
        case .pFoodQueryGoodsBySearch:
            return "/pfoodOrder/queryGoodsBySearch"
            
        case .pFoodQueryGoodsByMark:
            return "/pfoodOrder/queryGoodsByMark"
            
        case .pFoodSetRecordMark:
            return "/pfoodOrder/setRecordMark"
        case .pFoodQueryBalance:
            return "/pfoodOrder/queryBalance"
            
        case .pFoodQueryGoodsPrice:
            return "/pfoodOrder/queryGoodsPriceNew"
            
        case .supplierCheckBillHome:
            return "/checkingBill/supplierCheckBillHome"
        case .supplierTableQuery:
            return "/checkingBill/supplierTableQuery"
        case .queryInvoicLookUp:
            return "InvoiceController/queryInvoicLookUp"
        case .insertOrUpdateInvoicLookUp:
            return "InvoiceController/insertOrUpdateInvoicLookUp"
        case .queryInvoice:
            return "InvoiceController/queryInvoice"
        case .queryOrderList:
            return "InvoiceController/queryOrderList"
        case .openInvoice:
            return "InvoiceController/openInvoice"
        case .deleteInvoicLookUp:
            return "InvoiceController/deleteInvoicLookUp"
        case .getInvoiceDetail:
            return "InvoiceController/getInvoiceDetail"
        case .dieTypeLov:
            return "yhgl/YhAppDeadContrl/dieTypeLov"
        case .dieCauseLov:
            return "yhgl/YhAppDeadContrl/dieCauseLov"
        case .YhDeadUpdate:
            return "yhgl/YhAppDeadContrl/update"
        case .YhDeadSave:
            return "yhgl/YhAppDeadContrl/save"
        case .YhDeadRefer:
            return "yhgl/YhAppDeadContrl/refer"
        case .YhDeadUnrefer:
            return "yhgl/YhAppDeadContrl/unrefer"
        case .dieDormLov:
            return "yhgl/YhAppDeadContrl/dieDormLov"
        case .modeTypeLov:
            return "yhgl/YhAppDeadContrl/modeTypeLov"
        case .queryPictureList:
            return "yhgl/YhPicController/queryPictureList"
        case .YhDeadqueryList:
            return "yhgl/YhAppDeadContrl/queryList"
        case .uploadPicture_f:
            return "yhgl/YhPicController/uploadPic"
        case .deletePicture_f:
            return "yhgl/YhPicController/deleteFileById"
        case .YhDeaddelete:
            return "yhgl/YhAppDeadContrl/delete"
        case .carloglist:
            return "/car/log/list"
        case .carlogid:
            return "/car/log"
        case .carlogsave:
            return "/car/log/save"
        case .carlogupdate:
            return "/car/log/update"
        case .saveTriplog:
            return "/car/saveTriplog"
        case .carlogdelete:
            return "/car/log/delete"
        case .carfilelist:
            return "/car/file/list"
        case .carfeelist:
            return "/car/fee/list"
        case .carfeesave:
            return "/car/fee/save"
        case .carfeeupdate:
            return "/car/fee/update"
        case .carfee:
            return "/car/fee"
        case .carfileDelete:
            return "/car/file/delete/one"
            
        case .carlocationlist:
            return "/car/location/list"
        case .getGoodsType:
            return "/car/getGoodsType"
        case .carlocationupload:
            return "/car/location/upload"
        case.queryBranchClient:
            return "/pfoodOrder/queryBranchClient"
        case .saveFeedbackInfo:
            return "/info/saveFeedbackInfo"
        case .queryFeedbackInfo:
            return "/info/queryFeedbackInfo"
        case .getFeedbackInfo:
            return "/info/getFeedbackInfo"
        case .delFeedbackInfo:
            return "/info/delFeedbackInfo"
        case .queryZbCarInfo:
            return "/car/queryZbCarInfo"
        case .getTripLog:
            return "/car/getTripLog"
        case .updateZbCarInfo:
            return "/car/updateZbCarInfo"
        case .delZbCarInfo:
            return "/car/delZbCarInfo"
        case .queryProtocol:
            return "/ztb/queryProtocol"
        case .saveProtocolSure:
            return "/ztb/saveProtocolSure"
        case .abandonAuction:
            return "/ztb/abandonAuction"

        case .eSignQueryScale:
            return "/ContractController/queryScale"
        case .eSignQueryLibrary:
            return "/ContractController/queryLibrary"
        case .eSignQueryPay:
            return "/ContractController/queryPay"
        case .eSignGetFileList:
            return "ContractController/getFileList"
        case .eSignDeleteFile:
            return "ContractController/deleteFile"
        case .eSignUploadFiles:
            return "ContractController/uploadFiles"
        case .getServerTime:
            return "/ztb/getServerTime"
        case .queryMytenderJpListDetailV3:
            return "/ztb/queryMytenderJpListDetailV3"
        case .queryMytenderZbListDetail:
            return "/ztb/queryMytenderZbListDetail"
        case .queryStock:
            return "/ztb/queryStock"
        case .setDefaultGroup:
            return "setDefaultGroup"
        }
    }
    
    var method: Moya.Method {
        switch self {
        case .addr(let api):
            return api.method
        case .authcsrf:
            return .get
        default:
            return .post
        }
    }
    
    var sampleData: Data {
        return "{}".data(using: String.Encoding.utf8)!
    }
    
    var task: Task {
        switch self {
        case .addr(let api):
            return api.task
        case let .login(username, password,identity_type):
            return .requestParameters(parameters: ["logid": username, "pwd": password,"identity_type":identity_type], encoding: URLEncoding.default)
        case .getBrand:
            return .requestParameters(parameters: ["": ""], encoding: URLEncoding.default)
            
        case let .getOrders(page):
            return .requestParameters(parameters: ["perCount": pageLength, "currPage": page], encoding: URLEncoding.default)
        case let .getOrdersDetail(idkey):
            return .requestParameters(parameters: ["id_key": idkey], encoding: URLEncoding.default)
        case let .deleteOrder(idkey):
            return .requestParameters(parameters: ["id_key": idkey], encoding: URLEncoding.default)
        case let .getOrdersById(idkey):
            return .requestParameters(parameters: ["id_key": idkey], encoding: URLEncoding.default)
        case let .modifypwd(oldpwd, newpwd):
            return .requestParameters(parameters: ["oldpwd": oldpwd, "newpwd": newpwd], encoding: URLEncoding.default)
        case .queryClientAddress(let k_addr_type):
            return .requestParameters(parameters: ["sUrid": USERINFO.kfId!,"k_addr_type":k_addr_type], encoding: URLEncoding.default)
        case let .addClientAddress(data, idKey):
            return .requestParameters(parameters: ["data": data, "id_key": idKey], encoding: URLEncoding.default)
        case let .deleteClientAddress(idkey):
            return .requestParameters(parameters: ["id_key": idkey], encoding: URLEncoding.default)
        case let .updateOrders(main, detail):
            return .requestParameters(parameters: ["main": main, "detail": detail], encoding: URLEncoding.default)
        case .authcsrf,
                .getUnitDic:
            return .requestPlain
        case .getCheckingBill(let userId, let time):
            return .requestParameters(parameters: ["userId":userId,"time":time], encoding: URLEncoding.default)
        case .authLogin:
            return .requestData("{ \"email\": \"\(AppUrl.heqianEmail)\", \"password\": \"\(AppUrl.heqianPassword)\"}".data(using: String.Encoding.utf8, allowLossyConversion: true)!)
        case .thirdPart2submit_mobile:
            return .requestData(Verify_MobileDicStr.data(using: String.Encoding.utf8, allowLossyConversion: true)!)
        case .thirdPart2submit_bankcard:
            return .requestData(Verify_BankCardDicStr.data(using: String.Encoding.utf8, allowLossyConversion: true)!)
            
        case .ifFaceRecognition(let id,let clientId):
            return .requestParameters(parameters: ["id":id,"clientId":clientId], encoding: URLEncoding.default)
        case .signature(let userId, let time, let code, let clientId,let idNo):
            return .requestParameters(parameters: ["userId": userId, "time": time,"code":code,"clientId":clientId,"idNo":idNo], encoding: URLEncoding.default)
            
            
        case .getCheckingBillList(let userId):
            return .requestParameters(parameters: ["userId":userId], encoding: URLEncoding.default)
        case .getStockMonth(let begin_dt, let end_dt, let kf_id, let s_goods_code, let curr_page, let pageLength):
            return .requestParameters(parameters: ["begin_dt": begin_dt,"end_dt": end_dt,"kf_id": kf_id,"s_goods_code": s_goods_code,"curr_page": curr_page,"pageLength": pageLength], encoding: URLEncoding.default)
        case .viewContract(let fileNo):
            return .requestParameters(parameters: ["fileNo":fileNo], encoding: URLEncoding.default)
        case .accessToken_new(let userId):
            return .requestParameters(parameters: ["userId":userId], encoding: URLEncoding.default)
            
        case .getfaceid(let webankAppId, let orderNo, let userId, let nonce, let version, let sign, let name, let idNo):
            
            let json = dictionaryToJson(["webankAppId": webankAppId,"orderNo": orderNo,"userId": userId,"nonce": nonce,"version": version,"sign": sign,"name": name,"idNo": idNo])
            let data = json.data(using: String.Encoding.utf8)!
            return .requestData(data)
        case .addAuthentication(let name,let  idNo,let  id,let  phone,let  vouPhone,let  bankCard):
            
            
            return .requestParameters(parameters: ["name": name,"idNo": idNo,"id": id,"phone": phone,"vouPhone": vouPhone,"bankCard": bankCard], encoding: URLEncoding.default)
            
    
            
 
            
        case .queryMytenderZbBidList(let z_begin_dt, let z_end_dt,let z_province, let z_city, let z_price_min, let z_price_max, let page, let size, let z_title, let category):
            
            if category.isEmpty {
                return .requestParameters(parameters: ["z_begin_dt": z_begin_dt,"z_end_dt": z_end_dt,"z_province":z_province,"z_city": z_city,"z_price_min": z_price_min,"z_price_max": z_price_max,"page": page,"size": size,"z_title": z_title], encoding: URLEncoding.default)
            } else {
                return .requestParameters(parameters: ["z_begin_dt": z_begin_dt,"z_end_dt": z_end_dt,"z_province":z_province,"z_city": z_city,"z_price_min": z_price_min,"z_price_max": z_price_max,"page": page,"size": size,"z_title": z_title,"category":category], encoding: URLEncoding.default)
            }
            
        case .queryMytenderZbList(let z_begin_dt, let z_end_dt,let z_province, let z_city, let z_price_min, let z_price_max, let page, let size, let z_title, let category,let z_status):
            
            if category.isEmpty {
                return .requestParameters(parameters: ["z_begin_dt": z_begin_dt,"z_end_dt": z_end_dt,"z_province":z_province,"z_city": z_city,"z_price_min": z_price_min,"z_price_max": z_price_max,"page": page,"size": size,"z_title": z_title,"z_status":z_status], encoding: URLEncoding.default)
            } else {
                return .requestParameters(parameters: ["z_begin_dt": z_begin_dt,"z_end_dt": z_end_dt,"z_province":z_province,"z_city": z_city,"z_price_min": z_price_min,"z_price_max": z_price_max,"page": page,"size": size,"z_title": z_title, "category":category,"z_status":z_status], encoding: URLEncoding.default)
            }
            
          
        case .queryMytenderZbInfo(let id_key),
                .queryMytenderJpInfo(let id_key):
            return .requestParameters(parameters: [ "id_key": id_key], encoding: URLEncoding.default)
            
 
        case .referMytenderZbInfo(let id_key, let z_tag):
            return .requestParameters(parameters: ["id_key": id_key,"z_tag": z_tag], encoding: URLEncoding.default)
            
             
        case    .saveMytenderBidInfo(let data):
            return .requestParameters(parameters: ["data":data], encoding: URLEncoding.default)
            
        case .updateMytenderZbInfo(let data,let file),
                .saveMytenderZbInfo(let data,let file):
            var formDataAry = [MultipartFormData]()
            if file.isSome {
                let name = "\(USERINFO.usrid ?? "")\(Date.nowTimeToString).JPEG"
                let formData = MultipartFormData(provider: .data(file!), name: "files", fileName: name, mimeType: "image/jpeg")
                formDataAry.append(formData)
            }
            
            formDataAry += strArr2MultArr(["data":data])
            return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
            
        case  .saveFeedbackInfo(let data,let files):
             
            var formDataAry = [MultipartFormData]()
            for i in 0..<files.count {
                
                if files[i].type == .image {
                    let fdata = resetImgSize(sourceImage: files[i].image!, maxImageLenght: 500, maxSizeKB: 200)
                    
                    let name = "\(USERINFO.usrid ?? "")\(Date.nowTimeToString)_\(i).JPEG"
                    let formData = MultipartFormData(provider: .data(fdata), name: "files", fileName: name, mimeType: "image/jpeg")
                    formDataAry.append(formData)
                    
                } else if files[i].type == .file {
                    let name = "\(USERINFO.usrid ?? "")\(Date.nowTimeToString)_\(i).pdf"
                    let formData = MultipartFormData(provider: .data(files[i].data!), name: "files", fileName: name, mimeType: "image/pdf")
                    formDataAry.append(formData)
                } else {
                     //进行视频上传
                    let name = "\(USERINFO.usrid ?? "")\(Date.nowTimeToString)_\(i).mp4"
                    let formData = MultipartFormData(provider: .data(files[i].data!), name: "files", fileName: name, mimeType: "image/mp4")
                    formDataAry.append(formData)
                }
            }
          
            
            formDataAry += strArr2MultArr(["data":data])
            return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
            
        case .saveDepositPaymentInfo:
            return .requestPlain
        case .setRecordMark(let z_record_id, let z_mark, let z_type):
            return .requestParameters(parameters: ["z_record_id": z_record_id,"z_mark": z_mark,"z_type": z_type], encoding: URLEncoding.default)
            
        case .deleteMytenderZb(let id_key),
                .queryTbDepositPaymentInfo(let id_key),
                .deleteMytenderTbInfo(let id_key),
                .queryMytenderWinInfo(let id_key),
                .queryAuctionInfo(let id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case .queryMytenderTbInfo(let z_tb_id):
            return .requestParameters(parameters: ["z_tb_id": z_tb_id], encoding: URLEncoding.default)
        case .queryBidInfo(let z_bid_id):
            return .requestParameters(parameters: ["z_bid_id": z_bid_id], encoding: URLEncoding.default)
        case .queryMytenderTbList(let page, let size, let z_zb_id, let z_title):
            return .requestParameters(parameters: ["page": page,"size": size,"z_zb_id": z_zb_id,"z_title": z_title], encoding: URLEncoding.default)
            
      
        case .getUserType:
            return .requestPlain
            
        case .RegUser(let verificationCode, let master):
            return .requestParameters(parameters: ["verificationCode": verificationCode,"master": master], encoding: URLEncoding.default)
            
        case .getUserInfoForUpdate(let idkey):
            return .requestParameters(parameters: ["idkey": idkey], encoding: URLEncoding.default)
            
        case .submitUserInfoForUpdate(let master):
            return .requestParameters(parameters: ["master": master], encoding: URLEncoding.default)
            
        case .getAuditInfoByProcess(let process):
            return .requestPlain
        case .updateSubmitWaitInfoNew,
                .getSendWorkAccStaff:
            return .requestPlain
        case .getSubmitWaitInfoByVouidVoc(let vou_id, let voc_cd):
            return .requestPlain
        case .getVouShowInfoNew(let proc_inst_id):
            return .requestParameters(parameters: ["proc_inst_id": proc_inst_id], encoding: URLEncoding.default)
        case .eventAudit(let vou_no, let voc_cd, let process, let memo, let vou_id, let staff_nm, let post_nm, let post_id, let staff_id, let verify_mark, let audit_id, let audit_dt, let task_id, let flow_var, let dept_id, let unit_id):
            return .requestPlain
        case .eventSendWork(let vou_no, let voc_cd, let process, let vou_id, let acc_staff_id, let send_dt, let send_post_id, let audit_id, let task_id):
            return .requestPlain
        case .regCheckInfo(let provider_tel, let tax_no):
            return .requestParameters(parameters: ["provider_tel": provider_tel,"tax_no": tax_no], encoding: URLEncoding.default)
            
        case .getMyDepositBalance(let z_staff_id):
            return .requestParameters(parameters: ["z_staff_id": z_staff_id], encoding: URLEncoding.default)
        case .myFavoriteList(let z_staff_id, let page,let size,let z_type,let category):
            
            
            
            
            if category.isEmpty {
                return .requestParameters(parameters: ["z_staff_id": z_staff_id,"page": page,"size": size,"z_type":z_type], encoding: URLEncoding.default)
            } else {
                return .requestParameters(parameters: ["z_staff_id": z_staff_id,"page": page,"size": size,"z_type":z_type,"category":category], encoding: URLEncoding.default)
            }
            
            
            
            
            
        case .queryMyDepositList(let z_staff_id, let audit_mark, let search_info,let page, let size):
            return .requestParameters(parameters: ["z_staff_id": z_staff_id,"audit_mark": audit_mark,"search_info":search_info,"page": page,"size": size], encoding: URLEncoding.default)
            
        case .refundMyDepositInfo(let id_key, let opt_type):
            return .requestParameters(parameters: ["id_key": id_key,"opt_type": opt_type], encoding: URLEncoding.default)
            
        case .abandonBidInfo(let id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case .getUpdateInfo:
            return .requestPlain
        case .queryCashFlowList(let page, let size):
            return .requestParameters(parameters: ["page": page,"size": size], encoding: URLEncoding.default)
            
        case .queryUserUnreadMessagesCount:
            return .requestPlain
        case .queryMessagesList(let page, let size):
            return .requestParameters(parameters: ["page": page,"size": size,"messageType":"0,1,2,3,4"], encoding: URLEncoding.default)
        case .setMessagesRead( let messageIdList):
            return .requestParameters(parameters: ["messageIdList":messageIdList], encoding: URLEncoding.default)
            
        case .giveUpToUpdate(let client_id):
            return .requestParameters(parameters: ["client_id": client_id], encoding: URLEncoding.default)
            
        case .getAccountInfo:
            return .requestPlain
        case let .queryNoticeInfo(page, size):
            return .requestParameters(parameters: ["page": page,"size": size], encoding: URLEncoding.default)
        case .queryNoticeInfoNotRead:
            return .requestPlain
        case let .saveNoticeRead(id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case .countNoticeInfoNotRead:
            return .requestPlain
        case let .getOrdersAudit(page , size, s_orderform_no),
            let .payApplyQuery(page , size, s_orderform_no):
            return .requestParameters(parameters: ["page": page,"size": size,"s_orderform_no":s_orderform_no], encoding: URLEncoding.default)
            
        case let .payApplySave(date , payMoney):
            return .requestParameters(parameters: ["date": date,"payMoney": payMoney], encoding: URLEncoding.default)
            
        case let .payApplyDelete(id_key),
            let .queryCollectionAccount(id_key),
            let .syncBankRecord(id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
            
        case .getDormAndVedioInfoByAccount( let client_id):
            return .requestParameters(parameters: ["client_id": client_id], encoding: URLEncoding.default)
            
        case let .queryLogistics(page, size, z_title, z_city, z_begin_dt, z_end_dt, z_type, z_status):
            return .requestParameters(parameters: ["page": page,"size": size,"z_title":z_title,"z_city":z_city,"z_begin_dt":z_begin_dt,"z_end_dt":z_end_dt,"z_type":z_type,"z_status":z_status], encoding: URLEncoding.default)
            
        case .getLogistics(let id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case let .saveLogistics(data, detail):
            return .requestParameters(parameters: ["data": data,"detail": detail], encoding: URLEncoding.default)
            
        case let .updateLogistics(data, detail):
            return .requestParameters(parameters: ["data": data,"detail": detail], encoding: URLEncoding.default)
            
        case .deleteLogistics( let id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case let .queryContract(page, size, z_title):
            return .requestParameters(parameters: ["page": page,"size": size,"z_title":z_title], encoding: URLEncoding.default)
            
        case .queryLogisticsCompany:
            return .requestPlain
            
        case .getReportInfo(let big_menu_id):
            return .requestParameters(parameters: ["big_menu_id": big_menu_id], encoding: URLEncoding.default)
        case .uploadPic(let images):
            
            var formDataAry = [MultipartFormData]()
            for (index,image) in images.enumerated() {
                //图片转成Data  顺便压缩
                let data:Data = resetImgSize(sourceImage: image, maxImageLenght: 800, maxSizeKB: 200)
                //根据当前时间设置图片上传时候的名字
                let date:Date = Date()
                let formatter = DateFormatter()
                formatter.dateFormat = "yyyy-MM-dd-HH:mm:ss"
                var dateStr:String = formatter.string(from: date as Date)
                //别忘记这里给名字加上图片的后缀哦
                dateStr = dateStr.appendingFormat("-%i.png", index)
                let formData = MultipartFormData(provider: .data(data), name: "picture", fileName: dateStr, mimeType: "image/jpeg")
                formDataAry.append(formData)
            }
            
            return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
            
        case .queryEquity(let member_type):
            return .requestParameters(parameters: ["": ""], encoding: URLEncoding.default)
            
        case .queryPackage:
            return .requestPlain
        case .memberSave(let due_date,  let member_type,  let package_type,  let client_id):
            return .requestPlain
        case .memberUpdate(let due_date,  let member_type, let package_type,  let client_id):
            return .requestPlain
        case .queryMemberInfo( let client_id):
            return .requestParameters(parameters: ["k_client_id": client_id], encoding: URLEncoding.default)
        case .refillDownOrder(let data):
            return .requestParameters(parameters: ["data": data], encoding: URLEncoding.default)
        case .getPic( let id_key):
            return .requestParameters(parameters: ["id_key": id_key], encoding: URLEncoding.default)
            
        case  let .uploadPicture_f(pic_data,images):
            var formDataAry = [MultipartFormData]()
            for (index,image) in images.enumerated() {
                //图片转成Data  顺便压缩
                let data:Data = resetImgSize(sourceImage: image, maxImageLenght: 800, maxSizeKB: 200)
                //根据当前时间设置图片上传时候的名字
                let date:Date = Date()
                let formatter = DateFormatter()
                formatter.dateFormat = "yyyy-MM-dd-HH:mm:ss"
                var dateStr:String = formatter.string(from: date as Date)
                //别忘记这里给名字加上图片的后缀哦
                dateStr = dateStr.appendingFormat("-%i.png", index)
                let formData = MultipartFormData(provider: .data(data), name: "picture", fileName: dateStr, mimeType: "image/jpeg")
                formDataAry.append(formData)
                
            }
            formDataAry += strArr2MultArr(["data":pic_data])
            
            return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
            
            
            
        case let .headUploadPic(id_key,image):
            
            
            var formDataAry = [MultipartFormData]()
            //图片转成Data  顺便压缩
            let data:Data = resetImgSize(sourceImage: image, maxImageLenght: 800, maxSizeKB: 200)
            //根据当前时间设置图片上传时候的名字
            let date:Date = Date()
            let formatter = DateFormatter()
            formatter.dateFormat = "yyyy-MM-dd-HH:mm:ss"
            var dateStr:String = formatter.string(from: date as Date)
            //别忘记这里给名字加上图片的后缀哦
            dateStr = dateStr.appendingFormat("-%i.png", image)
            let formData = MultipartFormData(provider: .data(data), name: "picture", fileName: dateStr, mimeType: "image/jpeg")
            formDataAry.append(formData)
            
            let dic = ["id_key":id_key]
            formDataAry += strArr2MultArr(["data":dictionaryToJson(dic)])
            return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
            //        case let .carfileDelete(id, path):
            //            let dic = ["id":id,"path":path]
            //            var sss = [[String:Any]]()
            //            sss.append(dic)
            //
            //             return .requestCompositeParameters(bodyParameters: sss,
            //                                                       bodyEncoding: JSONEncoding.default,
            //                                                       urlParameters: sss)
            
        case let .eSignUploadFiles(s_type, z_ht_no, files):
            let dic = ["s_type":s_type,"z_ht_no":z_ht_no]
            var formDataAry = [MultipartFormData]()
               formDataAry +=  videoImgArr2MultiData(arr: files, paramName: "file")
              formDataAry += strArr2MultArr(["data":dictionaryToJson(dic)])
             return .uploadCompositeMultipart(formDataAry, urlParameters: [:])
 
 
        case .carlogupdate(let data),
                .carlogsave(let data):
            return .requestCompositeParameters(bodyParameters: data,
                                               bodyEncoding: JSONEncoding.default,
                                               urlParameters: data)
        case .saveTriplog(let data):
            return .requestCompositeParameters(bodyParameters: data,
                                               bodyEncoding: JSONEncoding.default,
                                               urlParameters: data)
        case .carfeesave(let data),
                .carfeeupdate(let data):
            return .requestCompositeParameters(bodyParameters: data,
                                               bodyEncoding: JSONEncoding.default,
                                               urlParameters: data)
            
        case .queryStock(let page, let title):
            return .requestParameters(parameters: ["page": page, "size": KSGlobal.pageSize, "title": title], encoding: URLEncoding.default)
        default:
            let rrr = testXXX(self)
            let ooo =  Mirror(reflecting: self)
            if let ddd = rrr as? [String:Any] {
                let dic = ddd[ooo.children.first?.label ?? ""]! as! [String : Any]
                // 同时发送 两个地方 url 和 body 同时提交参数
                return .requestCompositeParameters(bodyParameters: dic,
                                                   bodyEncoding: JSONEncoding.default,
                                                   urlParameters: dic)
                //                return .requestParameters(parameters: dic, encoding: URLEncoding.default)
            } else {
                return .requestPlain
            }
            
        }
    }
    
    var headers: [String : String]? {
        
        switch self {
      
        case .thirdPart2submit_bankcard,
                .thirdPart2submit_mobile,
                .authLogin:
            return [Verify_headerName: Verify_token,"Content-Type":"application/json"]
            
        case .getfaceid:
            return ["Content-Type":"application/json;charset=UTF-8"]
        default:
            return ["token": TOKEN,"DEVICEID":fetchDeciveIdentifier(),"z_source":"2","version":VERSION]
        }
    }
    
    
    
    
}

 import ObjectMapper

struct ZyaXXXModel: Mappable {
   
   var main: ZyaReciverMain?
   var details: [ZyaLogisticsDetail]?
    init?(map: Map) {
       
   }
   // Mappable
   mutating func mapping(map: Map) {
       main <- map["main"]
       details <- map["details"]
    }
}
